using System;
using System.Collections.Generic;
using System.Text;

namespace MotionBlur.Butler.Model
{
    
    public class DutyOrder
    {

        private Guid _OrderID;
        private string _Name;
        private Type _Workflow;
        private int? _Timeout;
        private bool _Enabled;
        private List<DutyTrigger> _Triggers;
        private Dictionary<string,object> _Parameters;

        public DutyOrder(Type workflow)
        {
            this.Initialize(workflow, Guid.NewGuid(), null);
        }

        public DutyOrder(Type workflow, Guid orderID)
        {
            this.Initialize(workflow, orderID, null);
        }

        public DutyOrder(Type workflow, string name)
        {
            this.Initialize(workflow, Guid.NewGuid(), name);
        }

        public DutyOrder(Type workflow, Guid orderID, string name)
        {
            this.Initialize(workflow, orderID, name);
        }

        private void Initialize(Type workflow, Guid orderID, string name)
        {

            _Workflow = workflow;
            _OrderID = orderID;
            _Name = name;

            _Timeout = null;
            _Triggers = new List<DutyTrigger>();
            _Parameters = new Dictionary<string, object>();

        }

        public Guid OrderID
        {
            get { return _OrderID; }
            set { _OrderID = value; }
        }

        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        public Type Workflow
        {
            get { return _Workflow; }
            set { _Workflow = value; }
        }

        public int? Timeout
        {
            get { return _Timeout; }
            set { _Timeout = value; }
        }

        public bool Enabled
        {
            get { return _Enabled; }
            set { _Enabled = value; }
        }

        public List<DutyTrigger> Triggers
        {
            get { return _Triggers; }
            set { _Triggers = value; }
        }

        public Dictionary<string, object> Parameters
        {
            get { return _Parameters; }
            set { _Parameters = value; }
        }

    }

}
